import 'package:bloc/bloc.dart';
import 'package:ulearning_app/app_event.dart';
import 'package:ulearning_app/app_state.dart';

class AppBloc extends Bloc<AppEvent, AppState> {
  AppBloc() : super(AppInitial()) {

    on<Increment>((event,emit){

      print("increment event");

      emit(AppState(counter:   state.counter + 1));


    });


    on<Decrement>((event,emit){

      print("Decrement event");

      emit(AppState(counter:  state.counter - 1));


    });

  }
}
